import { Component } from "@angular/core";
import {RegisterServices} from "../../../app/services/http.register.services";
import {User} from "../../model/User"

@Component({
    selector:"register",
    templateUrl:"app/pages/register/register.html",
    styleUrls:["app/pages/register/register.scss"],
    providers:[RegisterServices]
})

export class Register{
    newUser:User = new User();
    registered:boolean=false;
    constructor(private registerServices:RegisterServices){

    }

    onSubmit(){
        this.registerServices.sendUser(this.newUser).subscribe(data=>{
            this.registered = true;
        },erro=>{
            console.log(erro);
        });
    }
}